Viewing 15 posts - 121 through 135 (of 159 total)
not sure this will be better than convert(), but can give it a try
select dateadd(day, 0, datediff(day, 0, getdate()))
January 25, 2006 at 5:31 am
>> Or use the number table function to populate the Numbers table (I that's what you meant, KH, I apologize...)
You are right. Using a number table is definately faster than...
January 24, 2006 at 6:14 am
>> SELECT INTO is turned off.
Get the DBA to pre-create the fixed number table with the required number of records. If it is not possible, try the number table function...
January 23, 2006 at 7:34 pm
Records in Number Table required pre-insert however Number Table Function is dynamic. Altough you can pre-insert up to the maximum of the data type used (int or bigint) but anyway...
January 23, 2006 at 3:37 am
select object_name(fkeyid) as parent_table, object_name(rkeyid) as fkey_table
from sysreferences
where constid = (select id from sysobjects where name = 'foreign_key_name')
January 23, 2006 at 3:01 am
Depending on the maximum possible value of MaxPeriod. If it is relatively small like < 10 then there is no harm using a derived table with union all. If the...
January 23, 2006 at 2:34 am
Try this :
select n.num, m.rfreq, m.pfreq
from tblmain m inner join MaxPeriods p
onm.rfreq= p.rfreq
cross join
(
select1 as num union all select 2 union all select 3 union all
select 4 union...
January 23, 2006 at 12:06 am
No. But you can use replication or RDA to download the tables & data. You still need to code the replication & RDA command in your application.
January 22, 2006 at 6:19 pm
>> alter this tempTable and add an identity column.
>> sqlserver says that id is an invalid column name.
what is the column name for the identity column ? Looks like...
January 22, 2006 at 6:15 pm
to un-install SQL Server, go to Control Panel and uninstall it. If for whatever reason it fails, you can manully uninstall it with reference to this http://support.microsoft.com/kb/290991/
January 8, 2006 at 9:08 pm
declare @sListvarchar(100), @sqlcmd nvarchar(1000)
select @sList = 'v1,v2,v3'
select @sqlcmd = 'select * from table where fld in ' + replace('(''' + @sList + ''')', ',', ''',''')
exec (@sqlcmd)
January 8, 2006 at 7:41 pm
Try this :
select d1.DateFrom as Date_From, d2.DateTo as Date_To
from#dates d1 inner join #dates d2
on d1.DateTo = d2.DateFrom
union all
select d.DateFrom, d.DateTo
from#dates d
wherenot exists (select *
from#dates d_1 inner join #dates d_2
on d_1.DateTo...
January 8, 2006 at 3:15 am
select * from Products p
inner join OtherInfo o
on p.ProductID = o.ProductID
where p.productid like '%' + @your_keyword + '%'
or o.manufacturer like '%' + @your_keyword + '%'
November 21, 2005 at 3:36 am
assumption : time in and time out are of same day
select emp_name, convert(char(7), work_date, 121) as work_month, sum(work_hour) as total_work_hour
from
(
selects.emp_name, convert(datetime, convert(char(8), s.log_time, 112)) as work_date, min(s.log_time) as start_time, max(e.log_time)...
November 15, 2005 at 3:17 am
try this :
change your case statement to
and v.agentCode like substring(@agentcode, 1, 2) + '%'
November 14, 2005 at 6:52 pm
Viewing 15 posts - 121 through 135 (of 159 total)